package com.xiaotong.shopping.admin.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xiaotong.shopping.admin.bean.UserOne;
import com.xiaotong.shopping.admin.bean.UserTow;
import com.xiaotong.shopping.admin.dao.shopping.UserOneDao;
import com.xiaotong.shopping.admin.dao.xiaotong.UserTowDao;
import com.xiaotong.shopping.admin.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service(group = "${shopping.group}")
public class HelloServiceImpl implements HelloService {

    @Autowired
    private UserOneDao userOneDao;

    @Autowired
    private UserTowDao userTowDao;

    @Override
    public String sayHello() {

        return "hello";
    }

    @Override
    public Map<Object, Object> show() {
        Map<Object, Object> map = new HashMap();
        List<UserOne> userOnes = userOneDao.selectAll();
        List<UserTow> userTows = userTowDao.selectAllTow();
        map.put("one", userOnes);
        map.put("tow", userTows);

        return map;

    }
}
